package com.example.photo.exception;

import com.example.photo.common.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class BusinessException extends RuntimeException{
    private static final long serialVersionUID = 4629535971655905624L;
    private final ErrorCode errorCode;
    private final String description;

    public BusinessException(ErrorCode errorCode, String description) {
        this.errorCode = errorCode;
        this.description = description;
    }

    public BusinessException(ErrorCode errorCode) {
        this.errorCode = errorCode;
        this.description = "";
    }
}